var app=angular.module('myApp',[])
app.filter('trustHtml', function ($sce) {
    return function (input) {
        return $sce.trustAsHtml(input);
    }
});
app.controller('myCtrl',['$scope','$http',function($scope,$http){
    $scope.menuLists={}
    $scope.curentIndex=1;
    $http({method:'get',url:"http://139.199.192.48:9090/api/getbaicaijiatitle"})
        .then(function (data) {

            $scope.menuLists=data.data.result;
            $scope.curentIndex=$scope.menuLists[0].titleId;
            //console.log($scope.menuLists);
        })
    $scope.goodLists={}
    $scope.changePage=function(id){
        //console.log(id);
        $http({method:'get',url:"http://139.199.192.48:9090/api/getbaicaijiaproduct?titleid="+id})

            .then(function (data) {
                $scope.curentIndex=id;
                $scope.goodLists=data.data.result;
                //console.log($scope.goodLists);
                //$scope.$apply()
            })
    }
    $http({method:'get',url:"http://139.199.192.48:9090/api/getbaicaijiaproduct?titleid=0"})
        .then(function (data) {
            $scope.goodLists=data.data.result;
            //console.log($scope.goodLists);
        })
}])









